<?php

    require_once($application_folder."/controllers/navigator.php");
    class Onsite_news extends navigator 
    {
        var $data = array();

        function Onsite_news () 
        { 
            parent::navigator();
            $this->load->model('vesti_m','vesti');
            $this->load->helper('json_encode');
        }
        function index(){
            switch($this->session->userdata('user')){
                case 'adriaex@t-com.me':
                $this->data['strana'] = 'adriaex';
                break;
                case 'ikukic@yahoo.com':
                $this->data['strana'] = 'busterminal';
                break;
                
            } 
            $this->data['podstrana'] = '';
            $this->carabiner->js('onsite_news.js'); 
            $this->navigate('news-view/'.$this->data['strana']); 
        }
        /*CITA PODATKE O VIJESTI {id     account_id     status     foto_path     created     updated     published}*/
        /*CITA NASLOV I TEKST VIJESTI  {title     text     news_id     lang_id}*/
        function citaj_podatke($ac_id){ 
            json_encode_get($this->vesti->listaj_vesti($ac_id,array('account_id'=> $ac_id,'status ='=>1)));
        }
        
    }
?>